package com.generic.type;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

public class Generic04 {
    public static void main(String[] args) throws Exception {
        Map<String, String> map = new HashMap<>();
        Method method = HashMap.class.getDeclaredMethod("put",
                                    new Class[] { Object.class, Object.class });
        method.invoke(map,888L, 999L);
        // {888=999}
        System.out.println(map);
        // java.lang.ClassCastException
        System.out.println(map.get(888L));
    }
}
